<?
	class test {	
		function show_functions($ext){
			print_r(get_extension_funcs($ext));
		}
		function show_exts() {
			print_r(get_loaded_extensions());
		}
		function showHelp() {
			global $argv;
			$me=$argv[0];
			$help=<<<HELP
$me [command]
-------------
commands:
	help: (this help)
	list: show tests
	gotest <id> (launch test id)


HELP;
			echo $help;
		}
		function manage($argv) {

			$cmd=$argv[2];
			switch(strtolower($cmd)) {
			case "list":
				echo "Showing tests\n";
				foreach($this->get_test_list() as $k=>$v) {
					echo "Test $k: $v\n";
				}
				break;
			case "help":
				$this->showHelp();
				break;
			case "gotest":
				$idtest=$argv[3];
				if (in_array($idtest,array_keys($this->get_test_list()))) {
					echo "OK, executing $idtest test\n";
					$this->do_test($idtest);
				}else {
					echo "Test $idtest not available\n";
				}
				break;
			default:
				echo "Command '$cmd' not understood, try help\n";
				$this->showHelp();
				break;				
			}
			
						
		}
	}
?>
